package com.htudata.node.dao;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import java.util.List;

import com.htudata.node.mapper.NodeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class NodeDao {
  @Autowired
  private NodeMapper nodeMapper;
  
  public JSONArray selectNodeIdsByUserId(List<Long> userIds) {
    JSONObject params = new JSONObject();
    params.put("userIds", userIds);
    return this.nodeMapper.selectNodeIdsByUserId(params);
  }
  
  public List<String> selectHostIdsByFlowId(String flowId) {
    return this.nodeMapper.selectHostIdsByFlowId(flowId);
  }
  
  public int insertNodeToNodeTemp(String flowId) {
    return this.nodeMapper.insertNodeToNodeTemp(flowId);
  }
}
